### 1
input()
n = list(map(int, input().split()))
n.sort()
for i in n:
    print(i, end=' ')

### 2
n,m = map(int,input().split())
bucket = [0] * (n + 1)
tickets = map(int,input().split()) #读入所有票
for i in tickets:
    bucket[i] += 1 #递增当前编号的票数
ans = ''
for i in range(1, n + 1):
    print((str(i) + " ") * bucket[i], end='') 